from django.db import models
from django.contrib.auth.models import User

import datetime

class Exam (models.Model):
    exam_id = models.IntegerField()
    name = models.CharField(max_length=64)
    date_created = models.DateField('date created')
    date_valid = models.DateField()
    date_expired = models.DateField()
    teachers_name = models.CharField(max_length=30)
    descriptions = models.CharField(max_length=256)

class Question(models.Model):
    question_Number = models.IntegerField()
    exam_id= models.ForeignKey(Exam)
    question_descriptions = models.CharField(max_length=200)

class Choice(models.Model):
    choice_id = models.IntegerField()
    Questions_id = models.ForeignKey(Question)
    choice = models.CharField(max_length=200)
    votes = models.IntegerField()
    right_answer = models.BooleanField()
    def __unicode__(self): return self.choice

